{include file='public/head2'}
<div id="main-page">
    <div class="wap">
        <div class="p-2">
            <div class="card br-10" style="height:0.94rem;">
                <div class="circle1" style="top:-0.7rem;"></div>
                <div class="circle2" style="bottom:-1.7rem;"></div>
                <div class="content tac" style="line-height:0.94rem;">
                    <h2>{$title}</h2>
                </div>
            </div>
        </div>
        <div class="data-box p-2">
            {foreach $list as $item}
            <?php $video=json_decode($item['video'],true);
                $video['path']=str_replace($_SERVER['DOCUMENT_ROOT'],"", $video['path']);
            
            ?>
            <div class="container br-10 bg-white p-2 mb-2">
              <p>视频标题：{$video['title']}</p>
              <p>最近30天平均播放时长：<strong class="avg_play_duration">{$item['avg_play_duration']}</strong></p>
              <p>最近30天评论数：<strong class="total_comment">{$item['total_comment']}</strong></p>
              <p>最近30天点赞数：<strong class="total_like">{$item['total_like']}</strong></p>
              <p>最近30天播放次数：<strong class="total_play">{$item['total_play']}</strong></p>
              <p>最近30天分享数：<strong class="total_share">{$item['total_share']}</strong></p>
            </div>
            {/foreach}
      </div>
    </div>
    <script>
      $(function(){
          var page = {$page};
          var limit = {$limit};
          var count = {$count};
          var totalheight = $(document).height()-50;//定义一个总的高度变量
          
          $(window).scroll(function () {
              if(count<limit*page){
                  return false;
              }
              totalheight = parseFloat($(window).height()) + parseFloat($(window).scrollTop());//浏览器的高度加上滚动条的高度 
              if ($(document).height() <= totalheight){ //当文档的高度小于或者等于总的高度的时候，开始动态加载数据
                  page++;
                  $.get("{$_W['baseurl']}/merch/salem/videodata?mid={$_GPC['mid']}&sale_id={$_GPC['sale_id']}&page="+page+'&limit='+limit, function(res){
                      var data = $(res).find('.data-box').html();
                      $('.data-box').append(data);
                  });
              }
          });
      });
  </script>
</div>
{include file='public/footer'}